home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c-part2 / 10053 < prev    next >
Encoding:
Internet Message Format  |  1996-08-05  |  919 b 

  1. Path: news.lava.net!coconut!usenet
  2. From: Dave Carien <davec@hawaii.edu>
  3. Newsgroups: comp.lang.c
  4. Subject: given: char foo[80]; there is no such thing as element foo[80] correct? (i.e. foo[80] = '\0' is beyond the array boundary)
  5. Date: Thu, 14 Mar 1996 18:53:42 -0800
  6. Organization: KnightSoft/Voyager
  7. Message-ID: <3148DBB6.1353@hawaii.edu>
  8. NNTP-Posting-Host: dialup61.aloha.com
  9. Mime-Version: 1.0
  10. Content-Type: text/plain; charset=us-ascii
  11. Content-Transfer-Encoding: 7bit
  12. X-Mailer: Mozilla 2.0 (Win16; I)
  13.  
  14. Yes or no on this, I just recently got confused by two different books. I 
  15. assume that the declaration foo[80] allocates storage for elements 0-79. 
  16. A string could be terminated by doing something like foo[79] = '\0', but 
  17. foo[80] = '\0' would be invalid because such an element does not exist. 
  18. Just looking for confirmation that I'm right here. A simple Y or N will 
  19. do thanks.
  20. -- 
  21. -Recently confused C programmer
  22.